<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>预定义常量</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqli.persistconns.html">mysqli扩展和持久化连接</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqli.notes.html">Notes</a></div>
 <div class="up"><a href="book.mysqli.html">Mysqli</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="mysqli.constants" class="appendix">
 <h1>预定义常量</h1>

 <p class="simpara">下列常量由此扩展定义，且仅在此扩展编译入 PHP 或在运行时动态载入时可用。</p>
  <dl>

   
    <dt id="constantmysqli-read-default-group"><strong><code>MYSQLI_READ_DEFAULT_GROUP</code></strong></dt>

    <dd>

     <p class="para">
      Read options from the named group from <var class="filename">my.cnf</var>
      or the file specified with <strong><code>MYSQLI_READ_DEFAULT_FILE</code></strong>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-read-default-file"><strong><code>MYSQLI_READ_DEFAULT_FILE</code></strong></dt>

    <dd>

     <p class="para">
      Read options from the named option file instead of from <var class="filename">my.cnf</var>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-opt-connect-timeout"><strong><code>MYSQLI_OPT_CONNECT_TIMEOUT</code></strong></dt>

    <dd>

     <p class="para">
      Connect timeout in seconds
     </p>
    </dd>

   
   
    <dt id="constantmysqli-opt-local-infile"><strong><code>MYSQLI_OPT_LOCAL_INFILE</code></strong></dt>

    <dd>

     <p class="para">
      Enables command <em>LOAD LOCAL INFILE</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-init-command"><strong><code>MYSQLI_INIT_COMMAND</code></strong></dt>

    <dd>

     <p class="para">
      Command to execute when connecting to MySQL server. Will automatically be re-executed when reconnecting.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-client-ssl"><strong><code>MYSQLI_CLIENT_SSL</code></strong></dt>

    <dd>

     <p class="para">
      Use SSL (encrypted protocol). This option should not be set by application programs; 
      it is set internally in the MySQL client library
     </p>
    </dd>

   
   
    <dt id="constantmysqli-client-compress"><strong><code>MYSQLI_CLIENT_COMPRESS</code></strong></dt>

    <dd>

     <p class="para">
      Use compression protocol
     </p>
    </dd>

   
   
    <dt id="constantmysqli-client-interactive"><strong><code>MYSQLI_CLIENT_INTERACTIVE</code></strong></dt>

    <dd>

     <p class="para">
      Allow <em>interactive_timeout</em> seconds
      (instead of <em>wait_timeout</em> seconds) of inactivity before
      closing the connection.  The client&#039;s session
      <em>wait_timeout</em> variable will be set to
      the value of the session <em>interactive_timeout</em> variable. 
     </p>
    </dd>

   
   
    <dt id="constantmysqli-client-ignore-space"><strong><code>MYSQLI_CLIENT_IGNORE_SPACE</code></strong></dt>

    <dd>

     <p class="para">
      Allow spaces after function names. Makes all functions names reserved words. 
     </p>
    </dd>

   
   
    <dt id="constantmysqli-client-no-schema"><strong><code>MYSQLI_CLIENT_NO_SCHEMA</code></strong></dt>

    <dd>

     <p class="para">
      Don&#039;t allow the <em>db_name.tbl_name.col_name</em> syntax.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-client-multi-queries"><strong><code>MYSQLI_CLIENT_MULTI_QUERIES</code></strong></dt>

    <dd>

     <p class="para">
      Allows multiple semicolon-delimited queries in a single <span class="function"><a href="mysqli.query.html" class="function">mysqli_query()</a></span> call.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-store-result"><strong><code>MYSQLI_STORE_RESULT</code></strong></dt>

    <dd>

     <p class="para">
      For using buffered resultsets
     </p>
    </dd>

   
   
    <dt id="constantmysqli-use-result"><strong><code>MYSQLI_USE_RESULT</code></strong></dt>

    <dd>

     <p class="para">
      For using unbuffered resultsets
     </p>
    </dd>

   
   
    <dt id="constantmysqli-assoc"><strong><code>MYSQLI_ASSOC</code></strong></dt>

    <dd>

     <p class="para">
      Columns are returned into the array having the fieldname as the array index.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-num"><strong><code>MYSQLI_NUM</code></strong></dt>

    <dd>

     <p class="para">
      Columns are returned into the array having an enumerated index.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-both"><strong><code>MYSQLI_BOTH</code></strong></dt>

    <dd>

     <p class="para">
      Columns are returned into the array having both a numerical index and the fieldname as the associative index. 
     </p>
    </dd>

   
   
    <dt id="constantmysqli-not-null-flag"><strong><code>MYSQLI_NOT_NULL_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Indicates that a field is defined as <em>NOT NULL</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-pri-key-flag"><strong><code>MYSQLI_PRI_KEY_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is part of a primary index
     </p>
    </dd>

   
   
    <dt id="constantmysqli-unique-key-flag"><strong><code>MYSQLI_UNIQUE_KEY_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is part of a unique index.
     </p>
    </dd>

   

   
    <dt id="constantmysqli-multiple-key-flag"><strong><code>MYSQLI_MULTIPLE_KEY_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is part of an index.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-blob-flag"><strong><code>MYSQLI_BLOB_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>BLOB</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-unsigned-flag"><strong><code>MYSQLI_UNSIGNED_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>UNSIGNED</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-zerofill-flag"><strong><code>MYSQLI_ZEROFILL_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>ZEROFILL</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-auto-increment-flag"><strong><code>MYSQLI_AUTO_INCREMENT_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>AUTO_INCREMENT</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-timestamp-flag"><strong><code>MYSQLI_TIMESTAMP_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>TIMESTAMP</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-set-flag"><strong><code>MYSQLI_SET_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>SET</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-num-flag"><strong><code>MYSQLI_NUM_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>NUMERIC</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-part-key-flag"><strong><code>MYSQLI_PART_KEY_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is part of an multi-index
     </p>
    </dd>

   
   
    <dt id="constantmysqli-group-flag"><strong><code>MYSQLI_GROUP_FLAG</code></strong></dt>

    <dd>

     <p class="para">
      Field is part of <em>GROUP BY</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-decimal"><strong><code>MYSQLI_TYPE_DECIMAL</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>DECIMAL</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-newdecimal"><strong><code>MYSQLI_TYPE_NEWDECIMAL</code></strong></dt>

    <dd>

     <p class="para">
      Precision math <em>DECIMAL</em> or <em>NUMERIC</em> field (MySQL 5.0.3 and up)
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-bit"><strong><code>MYSQLI_TYPE_BIT</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>BIT</em> (MySQL 5.0.3 and up)
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-tiny"><strong><code>MYSQLI_TYPE_TINY</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>TINYINT</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-short"><strong><code>MYSQLI_TYPE_SHORT</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>SMALLINT</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-long"><strong><code>MYSQLI_TYPE_LONG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>INT</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-fload"><strong><code>MYSQLI_TYPE_FLOAT</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>FLOAT</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-double"><strong><code>MYSQLI_TYPE_DOUBLE</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>DOUBLE</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-null"><strong><code>MYSQLI_TYPE_NULL</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>DEFAULT NULL</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-timestamp"><strong><code>MYSQLI_TYPE_TIMESTAMP</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>TIMESTAMP</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-longlong"><strong><code>MYSQLI_TYPE_LONGLONG</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>BIGINT</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-int24"><strong><code>MYSQLI_TYPE_INT24</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>MEDIUMINT</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-date"><strong><code>MYSQLI_TYPE_DATE</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>DATE</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-time"><strong><code>MYSQLI_TYPE_TIME</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>TIME</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-datetime"><strong><code>MYSQLI_TYPE_DATETIME</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>DATETIME</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-year"><strong><code>MYSQLI_TYPE_YEAR</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>YEAR</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-newdate"><strong><code>MYSQLI_TYPE_NEWDATE</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>DATE</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-interval"><strong><code>MYSQLI_TYPE_INTERVAL</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>INTERVAL</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-enum"><strong><code>MYSQLI_TYPE_ENUM</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>ENUM</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-set"><strong><code>MYSQLI_TYPE_SET</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>SET</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-tiny-blob"><strong><code>MYSQLI_TYPE_TINY_BLOB</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>TINYBLOB</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-medium-blob"><strong><code>MYSQLI_TYPE_MEDIUM_BLOB</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>MEDIUMBLOB</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-long-blob"><strong><code>MYSQLI_TYPE_LONG_BLOB</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>LONGBLOB</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-blob"><strong><code>MYSQLI_TYPE_BLOB</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>BLOB</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-var-string"><strong><code>MYSQLI_TYPE_VAR_STRING</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>VARCHAR</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-string"><strong><code>MYSQLI_TYPE_STRING</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>STRING</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-char"><strong><code>MYSQLI_TYPE_CHAR</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>CHAR</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-type-geometry"><strong><code>MYSQLI_TYPE_GEOMETRY</code></strong></dt>

    <dd>

     <p class="para">
      Field is defined as <em>GEOMETRY</em>
     </p>
    </dd>

   
   
    <dt id="constantmysqli-need-data"><strong><code>MYSQLI_NEED_DATA</code></strong></dt>

    <dd>

     <p class="para">
      More data available for bind variable
     </p>
    </dd>

   
   
    <dt id="constantmysqli-no-data"><strong><code>MYSQLI_NO_DATA</code></strong></dt>

    <dd>

     <p class="para">
      No more data available for bind variable
     </p>
    </dd>

   
   
    <dt id="constantmysqli-data-truncated"><strong><code>MYSQLI_DATA_TRUNCATED</code></strong></dt>

    <dd>

     <p class="para">
      Data truncation occurred. Available since PHP 5.1.0 and MySQL 5.0.5.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-enum-flag"><strong><code>MYSQLI_ENUM_FLAG</code></strong></dt>

    <dd>

     <p class="para">
     Field is defined as <em>ENUM</em>. Available since PHP 5.3.0.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-cursor-type-for-update"><strong><code>MYSQLI_CURSOR_TYPE_FOR_UPDATE</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-cursor-type-no-cursor"><strong><code>MYSQLI_CURSOR_TYPE_NO_CURSOR</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-cursor-type-read-only"><strong><code>MYSQLI_CURSOR_TYPE_READ_ONLY</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-cursor-type-scrollable"><strong><code>MYSQLI_CURSOR_TYPE_SCROLLABLE</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-stmt-attr-cursor-type"><strong><code>MYSQLI_STMT_ATTR_CURSOR_TYPE</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-stmt-attr-prefetch-rows"><strong><code>MYSQLI_STMT_ATTR_PREFETCH_ROWS</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-stmt-attr-update-max-length"><strong><code>MYSQLI_STMT_ATTR_UPDATE_MAX_LENGTH</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-set-charset-name"><strong><code>MYSQLI_SET_CHARSET_NAME</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-report-index"><strong><code>MYSQLI_REPORT_INDEX</code></strong></dt>

    <dd>

     <p class="para">
      Report if no index or bad index was used in a query.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-report-error"><strong><code>MYSQLI_REPORT_ERROR</code></strong></dt>

    <dd>

     <p class="para">
      Report errors from mysqli function calls.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-report-strict"><strong><code>MYSQLI_REPORT_STRICT</code></strong></dt>

    <dd>

     <p class="para">
      Throw a <em>mysqli_sql_exception</em> for errors instead of warnings.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-report-all"><strong><code>MYSQLI_REPORT_ALL</code></strong></dt>

    <dd>

     <p class="para">
      Set all options on (report all).
     </p>
    </dd>

   
   
    <dt id="constantmysqli-report-off"><strong><code>MYSQLI_REPORT_OFF</code></strong></dt>

    <dd>

     <p class="para">
      Turns reporting off.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-debug-trace-enabled"><strong><code>MYSQLI_DEBUG_TRACE_ENABLED</code></strong></dt>

    <dd>

     <p class="para">
      Is set to 1 if <span class="function"><a href="mysqli.debug.html" class="function">mysqli_debug()</a></span> functionality is enabled.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-server-query-no-good-index-used"><strong><code>MYSQLI_SERVER_QUERY_NO_GOOD_INDEX_USED</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-server-query-no-index-used"><strong><code>MYSQLI_SERVER_QUERY_NO_INDEX_USED</code></strong></dt>

    <dd>

     <p class="para">
     </p>
    </dd>

   
   
    <dt id="constantmysqli-refresh-grant"><strong><code>MYSQLI_REFRESH_GRANT</code></strong></dt>

    <dd>

     <p class="para">
      Refreshes the grant tables.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-refresh-log"><strong><code>MYSQLI_REFRESH_LOG</code></strong></dt>

    <dd>

     <p class="para">
      Flushes the logs, like executing the
      <em>FLUSH LOGS</em> <acronym>SQL</acronym> statement.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-refresh-tables"><strong><code>MYSQLI_REFRESH_TABLES</code></strong></dt>

    <dd>

     <p class="para">
      Flushes the table cache, like executing the
      <em>FLUSH TABLES</em> <acronym>SQL</acronym> statement.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-refresh-hosts"><strong><code>MYSQLI_REFRESH_HOSTS</code></strong></dt>

    <dd>

     <p class="para">
      Flushes the host cache, like executing the
      <em>FLUSH HOSTS</em> <acronym>SQL</acronym> statement.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-refresh-status"><strong><code>MYSQLI_REFRESH_STATUS</code></strong></dt>

    <dd>

     <p class="para">
      Reset the status variables, like executing the
      <em>FLUSH STATUS</em> <acronym>SQL</acronym> statement.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-refresh-threads"><strong><code>MYSQLI_REFRESH_THREADS</code></strong></dt>

    <dd>

     <p class="para">
      Flushes the thread cache.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-refresh-slave"><strong><code>MYSQLI_REFRESH_SLAVE</code></strong></dt>

    <dd>

     <p class="para">
      On a slave replication server: resets the master server information, and 
      restarts the slave. Like executing the <em>RESET SLAVE</em>
      <acronym>SQL</acronym> statement.
     </p>
    </dd>

   
   
    <dt id="constantmysqli-refresh-master"><strong><code>MYSQLI_REFRESH_MASTER</code></strong></dt>

    <dd>

     <p class="para">
      On a master replication server: removes the binary log files listed in the
      binary log index, and truncates the index file. Like executing the
      <em>RESET MASTER</em> <acronym>SQL</acronym> statement.
     </p>
    </dd>

   

  </dl>

</div>
<hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="mysqli.persistconns.html">mysqli扩展和持久化连接</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="mysqli.notes.html">Notes</a></div>
 <div class="up"><a href="book.mysqli.html">Mysqli</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>
